package com.example.demo.controller;

import com.example.demo.entity.Classes;
import com.example.demo.entity.Permission;
import com.example.demo.mapper.PermissionMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/Permission")
public class PermissionController {
    @Autowired
    private PermissionMapper permissionMapper;
    @GetMapping
    public List<Permission> index() {return permissionMapper.findAll();}
    @PostMapping
    public Integer save(@RequestBody Permission permission) { return permissionMapper.insert(permission); }
}
